package com.bosssoft.goods.domain.dto;

import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.stream.Collectors;

@Getter
@Setter
public class SpecPropDTO {
    private int propId;
    private String name;
    private List<SpuSpecPropDTO> attr;

    /**
     * 过滤属于该规格的spu特定参数
     * @param spuProp
     */
    public void putAttr(List<SpuSpecPropDTO> spuProp){
        this.attr = spuProp.stream()
                .filter(e -> e.getPropId() == this.propId)
                .collect(Collectors.toList());
    }
}
